import numpy as np
from datas import datas
X=[]
Y=[]
cityMark={"吕梁":1,"太原":2}
for i in datas:
    single=[]

    single.append(cityMark[i["city"]])
    single.append(i["area"])
    single.append(i["rooms"])
    single.append(i["school"])
    single.append(i["style"])
    X.append(single)
    Y.append(i["price"])

X=np.array(X)
Y=np.array(Y)

theta=np.linalg.pinv(X.T.dot(X)).dot(X.T).dot(Y)

print(theta.dot(np.array([2,100,2,1,1])))
